home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / evaltp5.zip / EVALUATE.PAS < prev   
Pascal/Delphi Source File  |  1993-01-04  |  938b  |  36 lines

  1. Program Evaluate;
  2. (* 10/1189  *)
  3. (* Uploaded by Pat Dant  *)
  4. (* Based on the Pascal Unit Eval that allows you to take a string
  5.    and perform a recurssive math function on the string resulting
  6.    in a real answer.
  7.    This Exe version allows the command line argument to be the string
  8.    and will print the answer on the screen at the current cursor position.*)
  9.  
  10. (* ExpValue unit is designed by Don McIver in his very well written program
  11.    SCB Checkbook Program. Currently version 4.2.*)
  12.  
  13. Uses  Dos, Crt, Eval;
  14.  
  15. const
  16.  EvalStrPos           =  1;
  17.  
  18. var
  19.  EvalString           :  string;
  20.  Answer               :  real;
  21.  EvalError            :  Boolean;
  22.  
  23.  begin
  24.    ClrScr;
  25.    Answer := 0;
  26.    EvalError := False;
  27.    Answer := ExpValue(ParamStr(EvalStrPos),EvalError );
  28.    if EvalError then begin
  29.       Writeln('Error in Command Line Format : ',Answer:8:2);
  30.       Halt;
  31.    end;
  32.    Write(Answer:8:2);
  33.  end.
  34.  
  35.  
  36.